{% extends 'layout.html' %}

{% block content %}

<div>
    <div class="container">
        <div style="margin-bottom: 7px">
            <a class="btn btn-success" href="/pretty/add/">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                新建号码
            </a>

             <div class="col-lg-6" style="float: right;width: 300px">
                <form method="get">
                    <div class="input-group">
                        <input type="text" name="q" class="form-control" placeholder="请输入要查询的号码" value="{{ search_data }}">
                          <span class="input-group-btn">
                            <button class="btn btn-default" type="submit">
                                <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                            </button>
                          </span>
                    </div><!-- /input-group -->
                </form>
             </div><!-- /.col-lg-6 -->
        </div><!-- /.row -->


        <div>

            <div class="panel panel-default">
              <div class="panel-heading">
                  <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
                  号码列表
              </div>

              <!-- Table -->
              <table class="table table-bordered" >
                <thead>
                  <tr>
                    <th>id</th>
                    <th>手机号</th>
                    <th>价格</th>
                    <th>级别</th>
                    <th>状态</th>
                    <th>操作</th>
                  </tr>
                </thead>
                <tbody>
                  {% for item in queryset %}
                      <tr>
                        <th scope="row">{{ item.id }}</th>
                        <td>{{ item.mobile }}</td>
                        <td>{{ item.price }}</td>
                        <td>{{ item.get_level_display }}</td>
                        <td>{{ item.get_status_display }}</td>

                        <td>
                            <a class="btn btn-primary btn-xs" href="/pretty/{{ item.id }}/edit/">编辑</a>
                            <a class="btn btn-danger btn-xs" href="/pretty/{{ item.id }}/delete/">删除</a>
                        </td>
                      </tr>
                  {% endfor %}
                </tbody>
              </table>


            </div>
        </div>
        <div style="margin-top: -25px">
                <ul class="pagination">
                    {{ page_string }}
                </ul>
        </div>
    </div>
</div>


{% endblock %}







